package org.yejiali.config.Knife4j;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc;

/**
 * @Author:yejiali
 * @Date:2025/2/15-02-15-13:52
 * @Decsription:org.yejiali.config
 * @Version:1.0
 */
@Configuration
@EnableSwagger2WebMvc
public class Swagger2Config {
    private ApiInfo webApiInfo(){
        return new ApiInfoBuilder()
                .title("博客接口")
                .description("该文档文章管理，试用Knife4j")
                .version("1.0")
                .build();
    }
    @Bean
    public Docket webApiConfig(){
        Docket webApi=new Docket(DocumentationType.SWAGGER_2)
                .groupName("用户端接口")
                .apiInfo(webApiInfo())
                .select()
                .apis(RequestHandlerSelectors.basePackage("org.yejiali.controller"))
                .build();
        return webApi;

    }
}
